<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<style>
 body{font-family:"微软雅黑";font-size:12px;color:#666666;background-color:#F9F9F6}
 *{margin: 0;} 
 a{text-decoration:none}
 img{border:0px}
.cat{background-color:#F9F9F6;margin-left:10px;}
.cat_list:hover{background-color:#fff;}
.title{background:url("__APP__/statics/tbg.gif");font-weight:bold}

#save{text-align:center;border:0;width:100%;height:40px;background-color:#fff;position:fixed;left:0px;bottom:0px;}
</style>
<body>
<div class="cat">
<table border="1" bordercolor="#DDDFFF" width="100%" style="border-collapse: collapse" cellpadding="5">
	<tr>
		<td align="right">上级分类：</td>
		<td>
		<select size="1" name="parent">

	       <option value="0">顶级分类</option>

<volist name="cat_list" id="cat_list">
	<if condition="$cat_list.cat_id eq $parent['cat_id']">
	      <option value="{$cat_list.cat_id}" selected>{$cat_list.fullname}</option>
	<else/>
	      <option value="{$cat_list.cat_id}">{$cat_list.fullname}</option>
	</if>
</volist>
	    </select>　
		</td>
	</tr>
	<tr>
		<td align="right">所属模型：</td>
		<td><select size="1" name="model">
<volist name="model" id="model">
    <if condition="$model.model_id eq $cat['model']">
           <option value="{$model.model_id}" selected>{$model.model_name}</option>
	<else/>
	       <option value="{$model.model_id}">{$model.model_name}</option>
	</if>
</volist>
        </select>
		</td>
	</tr>
	<tr>
		<td align="right">分类名称：</td>
		<td><input type="text" name="cat_name" value="{$cat.cat_name}"></td>
	</tr>
	<tr>
		<td align="right">SEO关键词：</td>
		<td><textarea rows="5" name="seo" cols="40">{$cat.seo_key}</textarea></td>
	</tr>
	<tr>
		<td align="right">是否显示：</td>
		<td><select name="is_show">
				<option value="0" <if condition="$cat.is_active eq 0">selected</if>>显示</option>
				<option value="1" <if condition="$cat.is_active eq 1">selected</if>>不显示</option>
			  </select>
	    </td>
	</tr>
	<tr>
		<td align="right">是否推荐：</td>
		<td><select name="is_hot">
				<option value="0" <if condition="$cat.is_hot eq 0">selected</if>>不推荐</option>
				<option value="1" <if condition="$cat.is_hot eq 1">selected</if>>推荐</option>
			  </select>
	    </td>
	</tr>
	<tr>
		<td align="right">分类图标：</td>
		<td><input type="text" name="icon" value="{$cat.icon}">图标放到/statics/icons/cate目录下</td>
	</tr>
</table>
</div>
<input name="cat_id" type="text" style="display:none" value="{$cat.cat_id}">
<div id="save"><input id="change" type="button" value="保存更改"></div>

<script src="__APP__/statics/jquery-1.9.1.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__APP__/statics/css/jNotify.jquery.css" />
<script type="text/javascript" src="__APP__/statics/jNotify.jquery.js"></script>
<script>
$(function(){
    $("#change").click(function(){
	    var cid=$("[name=cat_id]").val();
	    var parent=$("[name=parent]").val();
		var model=$("[name=model]").val();
		var name=$("[name=cat_name]").val();
		var seo=$("[name=seo]").val();
		var is_show=$("[name=is_show]").val();
		var icon=$("[name=icon]").val();
		var is_hot=$("[name=is_hot]").val();
         $.ajax({
		     type:"POST",
			 url:"__URL__/save_edit",
			 dataType:"json",
			 data:{'cid':cid,'parent':parent,'model':model,'name':name,'seo':seo,'is_show':is_show,'icon':icon,'is_hot':is_hot},
			 success:function(data){
			     if(data=='1'){
				   jSuccess("<strong>修改成功!</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){window.location.href="__URL__/index";}})
				 }else{
				   jError("<strong>修改失败！请重试</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
				 }
			 }
		 })
	})

})
</script>
</body>
</html>